﻿namespace Web.Control.WWW.Learn
{
    using System;
    using System.Data;
    using System.Configuration;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using Lx.Web.Common.ControlsUI;
    using System.Collections.Generic;
    using System.Collections;

    using BLF.WWW_WWW.Learn;
    using Model.WWW_User.LearnComment;
    using Model.WWW_User.User;    

    /// <summary>
    /// Default 的摘要说明
    /// </summary>
    public class Default : BaseControl
    {
        /// <summary>
        /// 学习语言
        /// </summary>
        protected string learnVal = "";
        /// <summary>
        /// 评论列表
        /// </summary>
        protected List<LearnCommentModel> commentList;
        /// <summary>
        /// 学习用户列表
        /// </summary>
        protected List<UserSummaryInfoModel> userList;
        /// <summary>
        /// 会说语言的用户列表
        /// </summary>
        protected List<UserSummaryInfoModel> userListSpeak;
        /// <summary>
        /// 评论记录
        /// </summary>
        protected int commentCount = 0;
        /// <summary>
        /// 会员记录
        /// </summary>
        protected int userCount = 0;
        /// <summary>
        /// 当前会员号
        /// </summary>
        protected string memberNo = "";
        protected string C0103 = string.Empty;
        protected string C0105 = string.Empty;
        protected override void OnLoad(EventArgs e)
        {
            C0103 = GetText("C0103");
            C0105 = GetText("C0105");
            memberNo = HttpContext.Current.User.Identity.Name;
            if (Request["lng"] != null && !String.IsNullOrEmpty(Request["lng"].ToString()))
            {
                learnVal = Request["lng"].ToString();
            }
            else
            {
                Response.End();
            }
            ArrayList arrList = new ArrayList();
            Model.CommonMessage commonM = Learn.GetLearnMembersAndComment(learnVal, learnVal, "", 1, 20, out arrList);
            commentList = arrList[0] as List<LearnCommentModel>;
            commentCount = (int)arrList[1];
            userList = arrList[2] as List<UserSummaryInfoModel>;
            userListSpeak = arrList[3] as List<UserSummaryInfoModel>;
			((Lx.Web.Common.UI.TDTPageBase)this.Page).DynamicTitle=GetText("LN500").Replace("{0}", GetLanguageText(learnVal));
            base.OnLoad(e);
        }
    }
}